<?php
/**
* 
*/
namespace app\common\validate;
use think\Validate;


class Comment extends Validate
{

		protected $rule =   [
	        'news_id'  => 'require|number',
  	        'content'   => 'require|max:200',
	        'to_user_id' => 'number',
	        'parent_id' => 'number',
	    ];

	    protected $message  =   [
	        'news_id.require' => '名称必须',
	        'news_id.number'     => 'news_id必须是数字',
	        'content.require'   => '内容必须',
	        'content.between'   => '内容只能在1-200之间',
	        'to_user_id.number'  => 'to_user_id必须是数字',
	        'parent_id.number'  => 'parent_id必须是数字',
	    ];

		protected $scene = [
	        'edit'  =>  ['content'],
	        'add'  =>  ['news_id','content','to_user_id','parent_id'],
	    ];

}















 ?>